﻿param($installPath, $toolsPath, $package, $project)

function Test-RegistryValue($path, $name)
{
    $key = Get-Item -LiteralPath $path -ErrorAction SilentlyContinue
    $key -and $null -ne $key.GetValue($name, $null)
}

function Set-RegistryValue($path, $name, $value)
{
	$exists = Test-RegistryValue $path $name
	if ($exists)
	{
		Set-ItemProperty -Path $path -Name $name -Value $value
	}
}

Set-RegistryValue HKCU:\Software\Microsoft\VisualStudio\10.0\DSLTools ShowWarningDialog "False"
Set-RegistryValue HKCU:\Software\Microsoft\VisualStudio\11.0\DSLTools ShowWarningDialog "False"

$resoucesFolder= $project.ProjectItems.Item("Resources");
$translationKeysFile = $resoucesFolder.ProjectItems.Item("TranslationKeys.tt")
$translationKeysFile.Object.RunCustomTool();

